import request from "@/service";

export const fetchMenusByUserId=(params)=>{
  return request.get('/menu/getMenusByUserId/'+params)
}


// 新增菜单相关API
export const getMenuList = (params) => {
  return request.get('/menu/list', { params })
}

export const getMenuById = (id) => {
  return request.get(`/menu/menuId/${id}`)
}

export const addMenu = (data) => {
  return request.post('/menu/add', data)
}

export const updateMenu = (data) => {
  return request.put('/menu/edit', data)
}

export const deleteMenu = (id) => {
  return request.delete(`/menu/delete/${id}`)
}

// 获取菜单下拉树
export const getMenuTree = () => {
  return request.get('/menu/tree')
}
